package o;

import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import com.huawei.appgallery.foundation.ui.framework.widget.dialog.dialogactivity.DialogActivity;
import com.huawei.gamebox.plugin.gameservice.manager.ErrorMsg$6;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import o.ckh.a;

public class ezk {
    private static Context ʽ;
    @SuppressLint({"UseSparseArrays"})
    private static final Map<Integer, Integer> ˊ = new HashMap<Integer, Integer>() {
        {
            put(Integer.valueOf(110033), Integer.valueOf(exp$f.ˈॱ));
            put(Integer.valueOf(110034), Integer.valueOf(exp$f.ʿॱ));
        }
    };
    @SuppressLint({"UseSparseArrays"})
    private static final Map<Integer, Integer> ˋ = new HashMap<Integer, Integer>() {
    };
    @SuppressLint({"UseSparseArrays"})
    private static final Map<Integer, Integer> ˎ = new HashMap<Integer, Integer>() {
        {
            put(Integer.valueOf(110016), Integer.valueOf(exp$f.ˏॱ));
            put(Integer.valueOf(110018), Integer.valueOf(exp$f.ॱˊ));
            put(Integer.valueOf(110019), Integer.valueOf(exp$f.ॱˊ));
            put(Integer.valueOf(110043), Integer.valueOf(exp$f.ˏॱ));
            put(Integer.valueOf(110045), Integer.valueOf(exp$f.ॱˊ));
            put(Integer.valueOf(110046), Integer.valueOf(exp$f.ॱˊ));
            put(Integer.valueOf(110047), Integer.valueOf(exp$f.ˏॱ));
            put(Integer.valueOf(110049), Integer.valueOf(exp$f.ॱˊ));
            put(Integer.valueOf(110050), Integer.valueOf(exp$f.ॱˊ));
            put(Integer.valueOf(110051), Integer.valueOf(exp$f.ˏॱ));
            put(Integer.valueOf(110053), Integer.valueOf(exp$f.ॱˊ));
            put(Integer.valueOf(110054), Integer.valueOf(exp$f.ॱˊ));
        }
    };
    @SuppressLint({"UseSparseArrays"})
    private static final Map<String, Integer> ˏ = new HashMap<String, Integer>() {
        {
            put("client.gs.getGameUpdateInfo_2", Integer.valueOf(110011));
            put("client.gs.getGameUpdateInfo_3", Integer.valueOf(110012));
            put("client.gs.getGameUpdateInfo_4", Integer.valueOf(110013));
            put("client.gs.getGameUpdateInfo_1", Integer.valueOf(110014));
            put("client.gs.checkSign_2", Integer.valueOf(110016));
            put("client.gs.checkSign_3", Integer.valueOf(110017));
            put("client.gs.checkSign_4", Integer.valueOf(110018));
            put("client.gs.checkSign_1", Integer.valueOf(110019));
            put("client.gs.getGameNotice_2", Integer.valueOf(110024));
            put("client.gs.getGameNotice_3", Integer.valueOf(110025));
            put("client.gs.getGameNotice_4", Integer.valueOf(110026));
            put("client.gs.getGameNotice_1", Integer.valueOf(110027));
            put("client.gs.addGamePlayerInfo_2", Integer.valueOf(110035));
            put("client.gs.addGamePlayerInfo_3", Integer.valueOf(110036));
            put("client.gs.addGamePlayerInfo_4", Integer.valueOf(110037));
            put("client.gs.addGamePlayerInfo_1", Integer.valueOf(110038));
            put("client.gs.getUserMsg_2", Integer.valueOf(110039));
            put("client.gs.getUserMsg_3", Integer.valueOf(110040));
            put("client.gs.getUserMsg_4", Integer.valueOf(110041));
            put("client.gs.getUserMsg_1", Integer.valueOf(110042));
            put("client.gs.addGameSubAcc_2", Integer.valueOf(110047));
            put("client.gs.addGameSubAcc_3", Integer.valueOf(110048));
            put("client.gs.addGameSubAcc_4", Integer.valueOf(110049));
            put("client.gs.addGameSubAcc_1", Integer.valueOf(110050));
            put("client.gs.updateGameSubAcc_2", Integer.valueOf(110051));
            put("client.gs.updateGameSubAcc_3", Integer.valueOf(110052));
            put("client.gs.updateGameSubAcc_4", Integer.valueOf(110053));
            put("client.gs.updateGameSubAcc_1", Integer.valueOf(110054));
        }
    };
    @SuppressLint({"UseSparseArrays"})
    private static final Map<Integer, Integer> ॱ = new HashMap<Integer, Integer>() {
        {
            put(Integer.valueOf(110048), Integer.valueOf(exp$f.ʽˋ));
            put(Integer.valueOf(110052), Integer.valueOf(exp$f.ʽˋ));
            put(Integer.valueOf(110044), Integer.valueOf(exp$f.ʽˋ));
            put(Integer.valueOf(110017), Integer.valueOf(exp$f.ʽˋ));
        }
    };
    private static Handler ॱॱ = new ErrorMsg$6(Looper.getMainLooper());

    public static String ॱ(Context context, int i) {
        String str = "";
        if (context == null) {
            return str;
        }
        if (ˎ.containsKey(Integer.valueOf(i))) {
            str = context.getString(((Integer) ˎ.get(Integer.valueOf(i))).intValue());
            return String.format(Locale.ROOT, str, new Object[]{String.valueOf(i)});
        } else if (ˋ.containsKey(Integer.valueOf(i))) {
            str = context.getString(((Integer) ˋ.get(Integer.valueOf(i))).intValue());
            return String.format(Locale.ROOT, str, new Object[]{String.valueOf(i)});
        } else if (ॱ.containsKey(Integer.valueOf(i))) {
            str = context.getString(((Integer) ॱ.get(Integer.valueOf(i))).intValue());
            return String.format(Locale.ROOT, str, new Object[]{String.valueOf(i)});
        } else if (!ˊ.containsKey(Integer.valueOf(i))) {
            return str;
        } else {
            str = context.getString(((Integer) ˊ.get(Integer.valueOf(i))).intValue());
            return String.format(Locale.ROOT, str, new Object[]{String.valueOf(i)});
        }
    }

    public static void ˎ(Context context, int i) {
        if (context != null) {
            ʽ = context;
            String ॱ = ॱ(context, i);
            if (!dof.ॱ(ॱ)) {
                Message message = new Message();
                message.what = 0;
                Bundle bundle = new Bundle();
                bundle.putString("msg", ॱ);
                message.setData(bundle);
                ॱॱ.sendMessage(message);
            }
        }
    }

    public static void ˋ(Context context, int i, a aVar) {
        if (context == null) {
            Logger.e("ErrorMsg", "[showDialog]the context is null");
            return;
        }
        ʽ = context;
        CharSequence ॱ = ॱ(context, i);
        if (dof.ॱ(ॱ)) {
            Logger.e("ErrorMsg", "[showDialog]the msg is null");
        } else {
            new DialogActivity.a(context, "gameServiceErrorMsg").ˊ(exp$f.ʽ).ॱ(ॱ).ˋ(-1, exp$f.ᐝ).ˋ(-2, exp$f.ʼ).ˏ(aVar).ˎ();
        }
    }

    public static void ˏ(Context context, int i, a aVar) {
        if (context != null) {
            if (ˎ.containsKey(Integer.valueOf(i))) {
                ˎ(context, i);
            } else if (ˋ.containsKey(Integer.valueOf(i))) {
                ˋ(context, i, aVar);
            } else if (ॱ.containsKey(Integer.valueOf(i))) {
                ˋ(context, i, aVar);
            }
        }
    }

    public static void ˋ(Context context, int i) {
        if (context != null) {
            ˏ(context, i, null);
        }
    }

    static String ॱ(String str) {
        if (!dof.ॱ(str) && ˏ.containsKey(str)) {
            return String.valueOf(ˏ.get(str));
        }
        return null;
    }
}
